﻿@{
    Bundle("jquery_validate");
    Bundle("jquery_cookie");
    Layout = "../Shared/_Default.cshtml";
    ViewBag.PageTitle = T(Res.Name("Title"), JDM.Int32(Model.EntityID));
}

@section Breadcrumb
{
    <a href="@Url.Action(Loc.Act("Index").Ctrl("Account"))">@T(Res.In("WebAdmin").Of("Navigation").Of("Membership").Name("Account"))</a> &gt;
}
<section class="box">
    <script type="text/javascript">
        jQuery(document).ready(function () {
            jQuery('@ID("#tabs")').tabs({
                create: function () {
                    jQuery(this).tabs('option', 'active', jQuery.cookie(jQuery(this).prop('id')));
                },
                activate: function (event, ui) {
                    jQuery.cookie(jQuery(this).prop('id'), ui.newTab.index());
                }
            });
        });
    </script>
    @if(!JDM.HasFlags(Model.Flags, "Verified"))
    {
        <script type="text/javascript">
            jQuery(document).ready(function () {
                jQuery('@ID("#dlg_verify")').dialog();
                jQuery('@ID("#btn_verify")').click(function () {
                    jQuery('@ID("#dlg_verify")').dialog("open");
                });
            });
        </script>
    }
    <header>
        <ul class="bar toolbar">
            <li>[</li>
            <li><label>@T(Res.Name("Verification"))</label></li>
            <li>&#8227;</li>
            <li><a class="confirm" href="@Url.Action(Loc.Act("InitVerification").Ctrl("Account").Set(new
            {
                id = JDM.Int32(Model.EntityID)
            }))">@T(Res.In("Common").Of("Act").Name("Request"))</a></li>
            @if(!JDM.HasFlags(Model.Flags, "Verified"))
            {
                <li>|</li>
                <li><a id="@ID("btn_verify")" href="#">@T(Res.In("Common").Of("Act").Name("Commit"))</a></li>
            }
            <li>]</li>
            <li class="separator"></li>
            @if(JDM.HasFlags(Model.Flags, "Active"))
            {
                <li><a class="button confirm" href="@Url.Action(Loc.Act("Deactivate").Ctrl("Account").Set(new
                {
                    id = JDM.Int32(Model.EntityID)
                }))">@T(Res.In("Common").Of("Act").Name("Deactivate"))</a></li>
            }
            else
            {
                <li><a class="button confirm" href="@Url.Action(Loc.Act("Activate").Ctrl("Account").Set(new
                {
                    id = JDM.Int32(Model.EntityID)
                }))">@T(Res.In("Common").Of("Act").Name("Activate"))</a></li>
                
            }
            <li class="separator"></li>
            <li><a class="button confirm" href="@Url.Action(Loc.Act("Delete").Ctrl("Account").Set(new
            {
                id = JDM.Int32(Model.EntityID)
            }))">@T(Res.In("Common").Of("Act").Name("Delete"))</a></li>
        </ul>
        <ul class="bar navbar">
            <li><a href="@Url.Action(Loc.Act("GoTo").Ctrl("Owner").Area("FileSystem").Set(new
            {
                accountID = JDM.Int32(Model.EntityID)
            }))">@T(Res.Name("FileOwner"))</a></li>
            <li class="separator">&middot;</li>
            <li><a href="@Url.Action(Loc.Act("GoTo").Ctrl("Member").Area("Forum").Set(new
            {
                accountID = JDM.Int32(Model.EntityID)
            }))">@T(Res.Name("ForumMember"))</a></li>
            <li class="separator">&middot;</li>
            <li><a href="@Url.Action(Loc.Act("GoTo").Ctrl("Author").Area("Publishing").Set(new
            {
                accountID = JDM.Int32(Model.EntityID)
            }))">@T(Res.Name("PublicationAuthor"))</a></li>
            <li class="separator">&middot;</li>
            <li><a href="@Url.Action(Loc.Act("GoTo").Ctrl("Manager").Area("Catalog").Set(new
            {
                accountID = JDM.Int32(Model.EntityID)
            }))">@T(Res.Name("CatalogManager"))</a></li>
            <li class="separator">&middot;</li>
            <li><a href="@Url.Action(Loc.Act("GoTo").Ctrl("Seller").Area("Commerce").Set(new
            {
                accountID = JDM.Int32(Model.EntityID)
            }))">@T(Res.Name("Seller"))</a></li>
        </ul>
        <h3>@ViewBag.PageTitle</h3>
    </header>
    <section>
        <div id="@ID("tabs")">
            <ul>
                <li><a href="@ID("#tab_1")">*</a></li>
                <li><a href="@ID("#tab_2")">@T(Res.Name("Roles"))</a></li>
                <li><a href="@ID("#tab_3")">@T(Res.Name("Comments"))</a></li>
                <li><a href="@ID("#tab_4")">@T(Res.Name("Attributes"))</a></li>
                <li><a href="@ID("#tab_5")">@T(Res.Name("Password"))</a></li>
                <li><a href="@ID("#tab_6")">@T(Res.Name("Sessions"))</a></li>
            </ul>
            <div id="@ID("tab_1")">
            @{
                Html.RenderPartial("_Update");
            }
            </div>
            <div id="@ID("tab_2")">
            @{
                Html.RenderPartial("_Roles");
            }
            </div>
            <div id="@ID("tab_3")">
            @{
                Html.RenderAction(Loc.Act("_Comments").Set(new
                {
                    accountID = JDM.Int32(Model.EntityID)
                }));
            }
            </div>
            <div id="@ID("tab_4")">
            @{
                Html.RenderPartial("_Attributes");
            }
            </div>
            <div id="@ID("tab_5")">
            @{
                Html.RenderPartial("_Password");
            }
            </div>
            <div id="@ID("tab_6")">
            @{
                Html.RenderPartial("_Sessions");
            }
            </div>
        </div>
        @if(!JDM.HasFlags(Model.Flags, "Verified"))
        {
            <div id="@ID("dlg_verify")">
                <script type="text/javascript">
                    jQuery(document).ready(function () {
                        jQuery('@ID("#form_verification")').validate({
                            rules: {
                                code: {
                                    required: true
                                }
                            }
                        });
                    });
                </script>
                <form id="@ID("form_verification")" action="@Url.Action(Loc.Act("CommitVerification").Ctrl("Account"))" method="get">
                    <input type="hidden" name="id" value="@JDM.Int32(Model.EntityID)" />
                    <table>
                        <tr>
                            <td><input type="text" name="code" /></td>
                        </tr>
                    </table>
                    <ul class="bar toolbar">
                        <li><button class="button confirm" type="submit">@T(Res.In("Common").Of("Act").Name("Submit"))</button></li>
                    </ul>
                </form>
            </div>
        }
    </section>
</section>
